package com.code.service.impl;

import com.code.service.HelpFeedbackService;
import com.code.user.client.HelpFeedbackClient;
import com.code.user.model.po.HelpFeedback;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;

/**
 * 帮助与反馈业务聚合服务层
 *
 * @author tangyifei
 */
@Service
@Slf4j
public class HelpFeedbackServiceImpl implements HelpFeedbackService {

    @Resource
    private HelpFeedbackClient helpFeedbackClient;

    /**
     * 添加帮助与反馈的内容
     *
     * @param helpFeedback 帮助与反馈持久层对象
     * @return 帮助与反馈实体
     */
    @Override
    public HelpFeedback addHelpFeedback(HelpFeedback helpFeedback) {
        helpFeedback.setCreateTime(new Date());
        helpFeedback.setUpdateTime(new Date());
        return helpFeedbackClient.add(helpFeedback);
    }
}
